import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt(); //木头数
        int k = sc.nextInt(); //段数
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }

        Arrays.sort(arr);

        int left = 1, right = arr[n - 1];
        int mid = 0;
        while (left < right) { //使用二分遍历所有可能的段长，最小为1，最大为所有原木的最大长度
            mid = left + (right - left) / 2;
            int count = 0;
            for (int i = 0; i < n; i++) { //按照 mid 来切，能切出多少段
                count += arr[i] / mid;
            }
            if (count > k) {
                left = mid + 1;
            } else if (count == k){
                System.out.println(mid);
                return;
            } else {
                right = mid;
            }
        }

        System.out.println(mid == 0 ? -1 : mid);

        sc.close();
    }
}
